using System;

using Microsoft.SPOT;
using Microsoft.SPOT.Input;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Hardware;

namespace Project
{
    class InfoWindow:Window
    {
        Canvas canvas = new Canvas();
        private Window infoWindow;

        public InfoWindow(Window mw)
        {
            infoWindow = new Window();
            infoWindow.Width = SystemMetrics.ScreenWidth;
            infoWindow.Height = SystemMetrics.ScreenHeight;

            CreateWindow();
        }


        public void CreateWindow()
        {
            Image image_logo = new Image(Resources.GetBitmap(Resources.BitmapResources.logo));
            image_logo.HorizontalAlignment = HorizontalAlignment.Center;
            image_logo.VerticalAlignment = VerticalAlignment.Center;
            Canvas.SetTop(image_logo, 0);
            Canvas.SetLeft(image_logo, 0);
            canvas.Children.Add(image_logo);

            Image image_return = new Image(Resources.GetBitmap(Resources.BitmapResources.imreturn));
            image_return.HorizontalAlignment = HorizontalAlignment.Center;
            image_return.VerticalAlignment = VerticalAlignment.Center;
            SimpleButton button_return = new SimpleButton(image_return, infoWindow.Width / 2, infoWindow.Height / 5);
            button_return.BackColor = Colors.White;
            Canvas.SetBottom(button_return, 0);
            Canvas.SetRight(button_return, 0);
            canvas.Children.Add(button_return);

            button_return.Click += new EventHandler(buttonReturn_Click);

            infoWindow.Child = canvas;
            infoWindow.Visibility = Visibility.Visible;
        }

        void buttonReturn_Click(object sender, EventArgs evt)
        {
            infoWindow.Close();
        }
    }
}
